package com.winit.schedule.job.tracker.event;

import java.util.ArrayList;
import java.util.List;

import com.winit.schedule.core.event.AbstractEvent;
import com.winit.schedule.core.model.AssignedTask;

public class TaskStatusChangeEvent extends AbstractEvent<TaskEventType> {

    private List<AssignedTask> tasks;

    private String             taskTrackerUuid;

    private String             exception;

    public TaskStatusChangeEvent(TaskEventType type, AssignedTask task, String taskTrackerUuid){
        super(type);
        this.tasks = new ArrayList<AssignedTask>();
        this.tasks.add(task);
        this.taskTrackerUuid = taskTrackerUuid;
    }

    public TaskStatusChangeEvent(TaskEventType type, AssignedTask task, String taskTrackerUuid, String exception){
        super(type);
        this.tasks = new ArrayList<AssignedTask>();
        this.tasks.add(task);
        this.exception = exception;
        this.taskTrackerUuid = taskTrackerUuid;
    }

    public TaskStatusChangeEvent(TaskEventType type, List<AssignedTask> tasks, String taskTrackerUuid){
        super(type);
        this.tasks = tasks;
        this.taskTrackerUuid = taskTrackerUuid;
    }

    public List<AssignedTask> getTasks() {
        return tasks;
    }

    public void setTasks(List<AssignedTask> tasks) {
        this.tasks = tasks;
    }

    public String getTaskTrackerUuid() {
        return taskTrackerUuid;
    }

    public void setTaskTrackerUuid(String taskTrackerUuid) {
        this.taskTrackerUuid = taskTrackerUuid;
    }

    public String getException() {
        return exception;
    }

    public void setException(String exception) {
        this.exception = exception;
    }

}
